//
//  DateCommand.m
//  AsiaDemo
//
//  Created by 123 on 13-9-15.
//  Copyright (c) 2013年 liu. All rights reserved.
//

#import "DateCommand.h"

@implementation DateCommand

+(NSString *)stringFormatFromDate:(NSDate* )date{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    return [formatter stringFromDate:date];
}

+(NSString *)stringFormatFromDate:(NSDate* )date WithStylr:(NSString *)style{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:style];
    return [formatter stringFromDate:date];
}

+(NSDate *)dateFormatFromString:(NSString *)string{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    return [formatter dateFromString:string];
}

+(NSDate *)dateFormatFromString:(NSString *)string WithStylr:(NSString *)style{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:style];
    return [formatter dateFromString:string];
}

@end
